﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace INSTA.BankSystem.DAL
{
    /// <summary>
    /// Attribute qui va décorer des classes afin d'indiquer
    /// à quelle table de la BDD la classe correspond.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class,
                    AllowMultiple   = false,
                    Inherited       = false)]
    public class TableAttribute : Attribute
    {
        private string _tableName;

        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="tableName">Name of the table.</param>
        public TableAttribute(string tableName)
        {
            _tableName = tableName;
        }

        /// <summary>
        /// Gets the name of the table.
        /// </summary>
        public string TableName
        {
            get         { return _tableName; }
        }
    }
}
